using System.Collections.Specialized;

namespace CloudStorage.API.Blobs
{
	/// <summary>
	/// The blob container class.
	/// Used to access and enumerate blobs in the container.
	/// Storage key credentials are needed to access private blobs but not for public blobs.
	/// </summary>
	public interface IBlobContainerDataContext : IBlobDataContext
	{
		/// <summary>
		/// Address and credential info for the Blob Container
		/// </summary>
    IStorageAccountInfo StorageAccountInfo { get; }

		/// <summary>
		/// The name of the Blob Storage Account
		/// </summary>
		string Name { get; }

		/// <summary>
		/// Get the properties for the container if it exists. (This is the way to find out if a contaier exists.)
		/// </summary>
		/// <returns>The properties for the container if it exists, null otherwise</returns>
		IBlobContainerProperties GetContainerProperties();

		/// <summary>
		/// Set the container metadata
		/// </summary>
		/// <param name="metadata">The metadata for the container. Can be null to indicate no metadata</param>
		void SetContainerMetadata(NameValueCollection metadata);

		/// <summary>
		/// This operation gets the ACL for the specified container.     
		/// </summary>    
		/// <returns>True if the ACL is public</returns>
		IBlobContainerACL GetContainerACL();

		/// <summary>
		/// This operation sets the ACL for the specified container. 
		/// The ACL indicates whether blobs in a container may be accessed publicly. All public access is anonymous.
		/// </summary>
		/// <param name="publicAccess">False if the container should be private</param>
		ICloudVersionable SetContainerACL(bool publicAccess);

		/// <summary>
		/// Deletes the current container.
		/// </summary>
		void DeleteContainer();

		/// <summary>
		/// Enumerates all blobs with a given prefix.
		/// </summary>
		/// <param name="prefix">A set of possible prefixes to use for listing blobs</param>
		/// <param name="combineCommonPrefixes">If true common prefixes with "/" as seperator</param>
		/// <returns>The list of blob properties and common prefixes</returns>
		IListBlobResponse ListBlobs(string prefix, bool combineCommonPrefixes);
	}
}